package cn.analysis.framework.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/** 地图矢量数据访问配置 */
@Configuration
public class SourceConfig implements WebMvcConfigurer {

    @Value("${map.realPath}")
    private String realPath;
    @Value("${map.accessPath}")
    private String accessPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(accessPath)
                .addResourceLocations("file:" + realPath);
    }
}
